package com.yyf.kafka.consumer;

import com.alibaba.fastjson.JSON;
import com.yyf.kafka.dto.MessageEntity;
import lombok.extern.slf4j.Slf4j;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;

/**
 * 壹 * @Author: yang
 * 貮 * @Date: 2019/11/5 15:08
 */
@Slf4j
@Component
public class SimpleConsumer {

	@KafkaListener(topics = "${kafka.topic.default}",containerFactory = "kafkaListenerContainerFactory")
	public void receive(MessageEntity message){
		log.info("收到主题"+"${kafka.topic.default}"+"的消息,{}",JSON.toJSONString(message));
	}
}
